package cn.signalpha.modules.shop.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 类说明
 *
 * @author suguangjun
*/
@Data
public class CartDTO implements Serializable {
	private static final long serialVersionUID = 1L;


	@Data
	public static class SaveDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		@NotNull
		@ApiModelProperty(value = "商品id")
		private Long goodsId;
		@NotNull
		@ApiModelProperty(value = "商品skuId，无规格传0")
		private Long goodsSkuId;
		@NotNull
		@Min(value = 1, message = "商品数量必须大于1")
		@ApiModelProperty(value = "购买数量")
		private Integer goodsNum;
	}

	@Data
	public static class UpdateDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		@NotNull
		@ApiModelProperty(value = "购物车id")
		private Long id;
		@Min(value = 1, message = "商品数量必须大于1")
		@ApiModelProperty(value = "购买数量")
		private Integer goodsNumber;
	}

}
